#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "MyGlWindow.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow),
    glWnd(new MyGlWindow)
{
    ui->setupUi(this);

    format.setMajorVersion(3);
    format.setMinorVersion(3);
    format.setProfile(QSurfaceFormat::CoreProfile);

    glWnd->setFormat(format);
    delete ui->centralWidget;

    ui->centralWidget = QWidget::createWindowContainer(glWnd, this);
    setCentralWidget(ui->centralWidget);
}

MainWindow::~MainWindow()
{
    delete ui;
}
